import openai
import tornado
from openai import OpenAI

from tornado_server import make_app
from auth import all_keys
client = OpenAI(
    api_key="sk-34",
    base_url="https://api.atpgroup.work/v1"
)
if __name__ == "__main__":
    file_path = "./.env"  # 替换为你的env文件路径
    key = all_keys
    # 打开文件
    with open(file_path, "r") as file:
        # 读取文件内容并去除每行末尾的换行符
        lines = [line.strip() for line in file.readlines()]
        for line in lines:
            key.append(line.strip())
    app = make_app()
    port = 8888
    app.listen(port)
    print(f"server is serve at http://localhost:{port}")
    tornado.ioloop.IOLoop.current().start()
